#include "main.h"

struct X_CONFIG* xconfig;

char* msg = "Hello World!";

int
main(void)
{
	xconfig = malloc(sizeof(struct X_CONFIG));
	drw_init(&xconfig);

	thread_start("dscf", 100, "jellyfish", 'a', 0.011);

	while(1)
	{
		drw_events(&xconfig);
	}

	drw_deinit(&xconfig);

	free(xconfig);
	return 0;
}

/*
int
main(void)
{
	Display* d;
	Window   w;
	XEvent   e;
	const char* msg = "Hello World!";
	int s;

	d = XOpenDisplay(NULL);
	if (d == NULL)
	{
		fprintf(stderr, "Cannot open display.\n");
		exit(1);
	}

	s = DefaultScreen(d);
	w = XCreateSimpleWindow(d, RootWindow(d, s), 10, 10, 100, 100, 1,
				BlackPixel(d, s), WhitePixel(d, s));

	XSelectInput(d, w, ExposureMask | KeyPressMask);
	XMapWindow(d, w);

	while (1)
	{
		XNextEvent(d, &e);
		if (e.type == Expose)
		{
			XFillRectangle(d, w, DefaultGC(d, s), 20, 20, 10, 10);
			XDrawString(d, w, DefaultGC(d, s), 10, 50, msg, strlen(msg));
		}

		if (e.type == KeyPress)
		{ break; }
	}

	XCloseDisplay(d);
	return 0;
}
*/
